subroutine F_readlabels(labels)
  use iso_c_binding, only: c_char,c_null_char
  implicit none
  interface
     subroutine C_readlabels(labs) bind(C, name="readLabels")
       use iso_c_binding, only: c_char,c_int
       character(kind=c_char) :: labs(*)
     end subroutine C_readlabels
  end interface

  integer nr,o,p
  character(len=4) :: labels(:)
  character(len=4) :: tmp

  character(kind=c_char), allocatable :: labs0(:)

  nr=size(labels)
  allocate (labs0(nr*4))
  call C_readlabels(labs0)
  do o=1,nr
    do p=1,4
        labels(o)(p:p)=labs0((o-1)*4+p)
    enddo
  enddo
end subroutine F_readlabels
